<?xml version="1.0"?>
<recipe>

<!--merge 表示需要合并到指定文件的内容 （表示AndroidManifest声明新建的Activity） -->
<!-- instantiate 表示创建文件到指定文件夹	（把需要创建文件的模板放在root文件夹下对应文件夹,针对自己的项目修改路径）	  -->
<#if injectionManifest&&generatedActivity>
   <merge from="root/AndroidManifest.xml.ftl"
             to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml" />
</#if>
	
<#if injectionTitleBar>		
    <merge from="root/res/values/strings.xml.ftl"
             to="${escapeXmlAttribute(resOut)}/values/strings.xml" />
</#if>

	<!--Activity-->
<#if generatedActivity>	
	
    <instantiate from="root/res/layout/activity_main.xml.ftl" 
					to="${escapeXmlAttribute(resOut)}/layout/${activity_layout_name}.xml" />
	
	<!--View-activity-->	
    <instantiate from="root/src/app_package/ui/activity/MvpActivity.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/${ActivityName}.java" />
 <!--打开指定文件-->
    <open file="${escapeXmlAttribute(srcOut)}/${ActivityName}.java" />
</#if>

<#if generatedFragment>	
	
    <instantiate from="root/res/layout/fragment_layout.xml.ftl" 
					to="${escapeXmlAttribute(resOut)}/layout/${fragment_layout_name}.xml" />
	
	<!--View-fragment-->	
    <instantiate from="root/src/app_package/ui/fragment/MvpFragment.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/${FragmentName}.java" />
 <!--打开指定文件-->
    <open file="${escapeXmlAttribute(srcOut)}/${FragmentName}.java" />
</#if>
<#if generatedDrawerFragment>	
	
    <instantiate from="root/res/layout/fragment_drawer_layout.xml.ftl" 
					to="${escapeXmlAttribute(resOut)}/layout/${fragment_drawer_layout_name}.xml" />
	
	<!--View-fragment-->	
    <instantiate from="root/src/app_package/ui/fragment/DrawerFragment.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/${DrawerFragmentName}.java" />
 <!--打开指定文件-->
    <open file="${escapeXmlAttribute(srcOut)}/${DrawerFragmentName}.java" />
</#if>
	
<#if injectionRecyclerView>	
	<#if !generatedFragment>	
    <instantiate from="root/res/layout/activity_main_item.xml.ftl" 
					to="${escapeXmlAttribute(resOut)}/layout/${activity_layout_name}_item.xml" />
	<#else>
    <instantiate from="root/res/layout/fragment_layout_item.xml.ftl" 
					to="${escapeXmlAttribute(resOut)}/layout/${fragment_layout_name}_item.xml" />
	</#if>
</#if>					   

<#if injectionEntity>	

	<!--View-activity-->	
    <instantiate from="root/src/app_package/entity/Entity.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/entity/${EntityName}.java" />
</#if>						   

<#if injectionMVP>
	<!--Presenter-->
    <instantiate from="root/src/app_package/ui/MvpPresenter.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/presenter/${PresenterName}.java" />
				   
	<!--Contact-->			   
    <instantiate from="root/src/app_package/ui/MvpContract.java.ftl"
                   to="${escapeXmlAttribute(srcOut)}/contract/${ContractName}.java" />
				   
 <!--打开指定文件-->
    <open file="${escapeXmlAttribute(srcOut)}/contract/${ContractName}.java" />
	
 <!--打开指定文件-->
    <open file="${escapeXmlAttribute(srcOut)}/presenter/${PresenterName}.java" />
</#if>				   
</recipe>
